package view;

import controller.AddCustomerController;
import controller.ViewCustomerController;

public class MenuCustomerPanel extends javax.swing.JPanel {

	private static final long serialVersionUID = 1L;
	@SuppressWarnings("unused")
	private ImagePanel menu;

	public MenuCustomerPanel(Home home) {
		this.home = home;
		initComponents();
		// jButton1.setVisible(false);
		menu = new ImagePanel("src/icon/menu.png");
		// jPanel1.add(menu);
		// menu.setBounds(0, 0, jPanel1.getWidth(), jPanel1.getHeight());
		// menu.repaint();
		
		controller();
	}

	private void initComponents() {

		toolbarCustomer = new javax.swing.JToolBar();
		btnViewCus = new javax.swing.JButton();
		btnAddCus = new javax.swing.JButton();

		setBackground(new java.awt.Color(255, 255, 255));
		setLayout(null);

		toolbarCustomer.setBackground(new java.awt.Color(255, 255, 255));
		toolbarCustomer.setBorder(null);
		toolbarCustomer.setFloatable(false);
		toolbarCustomer.setOrientation(javax.swing.SwingConstants.VERTICAL);
		toolbarCustomer.setRollover(true);
		toolbarCustomer.setOpaque(false);

		btnViewCus.setBackground(new java.awt.Color(255, 255, 255));
		btnViewCus.setFont(new java.awt.Font("Calibri", 1, 18));
		btnViewCus.setIcon(new javax.swing.ImageIcon("icon/viewcustomer.png"));
		btnViewCus.setText("View Customer");
		btnViewCus.setFocusable(false);
		btnViewCus.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
		btnViewCus.setOpaque(false);
		btnViewCus.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
		btnViewCus.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton1ActionPerformed(evt);
			}
		});
		toolbarCustomer.add(btnViewCus);

		btnAddCus.setBackground(new java.awt.Color(255, 255, 255));
		btnAddCus.setFont(new java.awt.Font("Calibri", 1, 18));
		btnAddCus.setIcon(new javax.swing.ImageIcon("icon/addcustomer.png"));
		btnAddCus.setText("Add Customer");
		btnAddCus.setFocusable(false);
		btnAddCus.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
		btnAddCus.setOpaque(false);
		btnAddCus.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
		toolbarCustomer.add(btnAddCus);

		add(toolbarCustomer);
		toolbarCustomer.setBounds(49, 110, 120, 160);
	}

	private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
	}

	
	private void controller(){
		btnViewCus.addActionListener(new ViewCustomerController(home));
		btnAddCus.addActionListener(new AddCustomerController(home));
	}
	
	private Home home;
	
	private javax.swing.JButton btnViewCus;
	private javax.swing.JButton btnAddCus;
	private javax.swing.JToolBar toolbarCustomer;
}
